package cn.hznc.controller.toolAnalyze;

import cn.hznc.controller.service.toolAnalyze.ToolConsumptionandUsageAnalysisService;
import cn.hznc.controller.service.toolAnalyze.ToolTypeUsageAnalysisReportService;
import cn.hznc.domain.entity.ToolTypeUsageAnalysisReportDetailEntity;
import cn.hznc.domain.entity.ToolTypeUsageAnalysisReportEntity;
import cn.hznc.domain.entity.TypeEntity;
import cn.hznc.domain.request.toolAnalyze.ToolTypeUsageAnalysisReportDetailReq;
import cn.hznc.domain.request.toolAnalyze.ToolTypeUsageAnalysisReportReq;
import cn.hznc.domain.response.PageResult;
import cn.hznc.domain.response.ResponseBody;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/toolTypeUsageAnalysisReport")
public class ToolTypeUsageAnalysisReportController {

    @Resource
    private ToolTypeUsageAnalysisReportService toolTypeUsageAnalysisReportService;

    @RequestMapping(value = "/queryToolTypeUsageAnalysisReport", method = RequestMethod.POST)
    public ResponseBody<PageResult<ToolTypeUsageAnalysisReportEntity>> test5(@RequestBody ToolTypeUsageAnalysisReportReq toolTypeUsageAnalysisReportReq){
        return ResponseBody.success(toolTypeUsageAnalysisReportService.queryToolTypeUsageAnalysisReport(toolTypeUsageAnalysisReportReq));
    }

    @RequestMapping(value = "/queryToolStock", method = RequestMethod.POST)
    public ResponseBody queryToolStock(@RequestBody ToolTypeUsageAnalysisReportReq toolTypeUsageAnalysisReportReq){
        return ResponseBody.success(toolTypeUsageAnalysisReportService.queryToolStock(toolTypeUsageAnalysisReportReq));
    }

    @RequestMapping(value = "/queryToolInboundAndOutbound", method = RequestMethod.POST)
    public ResponseBody queryToolInboundAndOutbound(@RequestBody ToolTypeUsageAnalysisReportReq toolTypeUsageAnalysisReportReq){
        return ResponseBody.success(toolTypeUsageAnalysisReportService.queryToolInboundAndOutbound(toolTypeUsageAnalysisReportReq));
    }

    @RequestMapping(value = "/queryToolInboundAndOutboundDetail", method = RequestMethod.POST)
    public ResponseBody queryToolInboundAndOutboundDetail(@RequestBody ToolTypeUsageAnalysisReportReq toolTypeUsageAnalysisReportReq){
        return ResponseBody.success(toolTypeUsageAnalysisReportService.queryToolInboundAndOutboundDetail(toolTypeUsageAnalysisReportReq));
    }



    @RequestMapping(value = "/qryLowSafetyInventory", method = RequestMethod.POST)
    public ResponseBody qryLowSafetyInventory(@RequestBody ToolTypeUsageAnalysisReportReq toolTypeUsageAnalysisReportReq){
        return ResponseBody.success(toolTypeUsageAnalysisReportService.qryLowSafetyInventory(toolTypeUsageAnalysisReportReq));
    }


    @RequestMapping(value = "/queryToolTypeUsageAnalysisReportDetail", method = RequestMethod.POST)
    public ResponseBody<PageResult<ToolTypeUsageAnalysisReportDetailEntity>> queryToolTypeUsageAnalysisReportDetail(@RequestBody ToolTypeUsageAnalysisReportDetailReq toolTypeUsageAnalysisReportDetailReq){
        return ResponseBody.success(toolTypeUsageAnalysisReportService.queryToolTypeUsageAnalysisReportDetail(toolTypeUsageAnalysisReportDetailReq));
    }
}
